home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fatted Calf
/
The Fatted Calf.iso
/
Applications
/
DockExtenders
/
LaunchPad
/
Source
/
IconAlign.ps
< prev
next >
Wrap
Text File
|
1993-12-14
|
2KB
|
83 lines
%!
% IconAlign.ps - a simple program to neatly arrange all screen icons at the
% bottom of the screen. Some portions ruthlessly hacked out of gravity.ps.
% Disclaimer: I make no assurances of the robustness of this code. Use at
% your own risk.
% Varun Mitroo
% 25 August, 1991
% numwins - number of windows
% windowlist - array[window# of screen window]
% wincoordinates - array[coordinates of windows(x, y, width, height]
/windowlist
0 countscreenlist /numwins exch def numwins array
0 screenlist
def
/wincoordinates numwins array def
/savecoordinates numwins array def
0 1 numwins 1 sub
{
dup
/coords 4 array def
windowlist exch get currentwindowbounds
coords 3 3 -1 roll put
coords 2 3 -1 roll put
coords 1 3 -1 roll put
coords 0 3 -1 roll put
savecoordinates exch coords put
}for
0 1 numwins 1 sub
{
dup
/coords 4 array def
windowlist exch get currentwindowbounds
coords 3 3 -1 roll put
coords 2 3 -1 roll put
coords 1 3 -1 roll put
coords 0 3 -1 roll put
wincoordinates exch coords put
}for
/xcount 0 def
/ycount 0 def
0 1 numwins 3 sub {
/num exch def
/cwin windowlist num get def
wincoordinates num get aload pop /height exch def /width exch def /ypos exch def /xpos exch def
width 64 eq {
height 64 eq {
xpos 1052 lt {
/xpos xcount def
/ypos ycount def
xpos ypos cwin movewindow
/xcount xcount 64 add def
xcount 1024 ge {
/xcount 0 def
/ycount ycount 64 add def
} if
} if
} if
} if
}for
% The following lines wait for a mouse and restore the icons to the original
%location. Uncomment them if you don't want the effects to be permanent.
%{
% buttondown {exit} if
%} loop
%0 1 numwins 2 sub
%{
% /num exch def
% /cwin windowlist num get def
% savecoordinates num get aload pop pop pop cwin movewindow
%}for